function print_results_of_pathway(numberOfPathway, numberOfsecondPathway, analyzedPathIndex, addModel, time)
    analyzedPathways = evalin('base','analyzedPathways');
    listOfPathways = evalin('base','listOfPathways');
    model = evalin('base','model');
    defines = evalin('base','defines');

    if any(strcmp(who,'dname'))
        dname = evalin('base','dname');
    else
        dname = [pwd filesep 'experiments-'  time];
        mkdir(dname);
    end
    filepath = [dname filesep num2str(numberOfPathway) '_' num2str(numberOfsecondPathway) ];
    mkdir(filepath);

    if addModel
        if str2num(defines.isProductUsed) & str2num(defines.isSubstrateUsed)
            prod_listOfPathways = evalin('base', 'prod_listOfPathways'); 

            [ps, lp,zs, lp, arrayOfWeightsOfPathway, returnModel] = ...
                        get_pathway_statistics(listOfPathways{numberOfPathway}, model,  true, false); 

            [pps, plp, pzs, plp, pw, modelToReturn] = ...
                get_pathway_statistics(prod_listOfPathways{numberOfsecondPathway}, returnModel,  false, true, arrayOfWeightsOfPathway(2));
        else
            [ps,lm,zs,lp,lw, modelToReturn] = ...
                        get_pathway_statistics(listOfPathways{numberOfPathway}, model,  true, false);
        end            

        save(strcat([filepath filesep 'model_' num2str(numberOfPathway) '.mat']), 'modelToReturn');
    end

    outputString = print_results_of_pathway_to_results_windows(numberOfPathway, numberOfsecondPathway, analyzedPathIndex);
    WriteToFile(strcat([filepath filesep num2str(numberOfPathway) '.txt']), outputString);

function WriteToFile(filename, text)
    fid = fopen(filename, 'w');
    fprintf(fid, text);
    fclose(fid);